package com.gjw.designpattern.factory.simpleFactory;

/**
 * @Author gjw
 * 简单工厂模式
 * 简单工厂模式违反开闭原则。
 *
 */
public class Client {


    public static void main(String[] args) {
        PhoneFactory phoneFactory = new PhoneFactory();
        SanXingPhone sx = (SanXingPhone) phoneFactory.getPhone("三星");
        HuaWeiPhone huawei = (HuaWeiPhone) phoneFactory.getPhone("华为");
        System.out.println("手机："+sx.getName()+"==颜色："+sx.getColor());
        System.out.println("手机："+huawei.getName()+"==颜色："+huawei.getColor());
    }
}
